<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        /* 
        instanceof可以判断一个对象是否是某个构造函数的实例
         */
         var arr1 = [];
         var arr2 = ['aa','bb'];
         var arr3 = 'abc'
         var arr4 = new String("abc")

         //判断arr1和arr2是数组吗？
         console.log(arr1 instanceof Array)
         console.log(arr2 instanceof Array)
         console.log(arr3 instanceof Object)
         console.log(arr4 instanceof Object)


         function Car(make, model, year) {
             this.make = make;
             this.model = model;
             this.year = year;
            }
            function Dog(name, age, color) {
             this.name = name;
             this.age = age;
             this.color = color;
            }
            const auto = new Car('Honda', 'Accord', 1998);

            console.log(auto instanceof Car);
            // expected output: true

            console.log(auto instanceof Object);
            // expected output: true

            //总结：只要是对象都属于Object
            /* 
                描述汽车
                汽车的对象表示：
                    1.宝马汽车
                    2.奥迪汽车
                    3.奔驰汽车
                    .....

                    Object：就相当于是汽车，有所欲汽车的共性，比如汽车有四个轮子
             */
            
    </script>
</head>
<body>
    
</body>
</html>